package com.black.cat.seed.entity;


import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;
import javax.validation.constraints.*;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 用户表
 *
 * @author blackcat
 * @since 2020-07-21
 */
@Data
@TableName("sec_user")
@ApiModel(description = "用户表")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @NotNull()
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "用户名")
    @NotBlank
    private String username;

    @ApiModelProperty(value = "密码")
    @NotBlank
    private String password;

    @ApiModelProperty(value = "昵称")
    private String nickname;

    @ApiModelProperty(value = "手机")
    private String phone;

    @ApiModelProperty(value = "邮箱")
    private String email;

    @ApiModelProperty(value = "生日")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date birthday;

    @ApiModelProperty(value = "性别，男-1，女-2")
    private Integer sex;

    @ApiModelProperty(value = "状态，启用-1，禁用-0")
//    @NotNull
    private Integer status;

    @ApiModelProperty(value = "创建时间")
    @TableField(
            fill = FieldFill.INSERT
    )
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    @TableField(
            fill = FieldFill.INSERT_UPDATE
    )
    private Date updateTime;

}
